import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

// css样式初始化
import 'normalize.css/normalize.css'

import '@/assets/style/index.scss'
import '@/assets/style/iconfont/iconfont.css'

import './plugins/element.js'
// 引入baseInfo
import baseInfo from './utils/config'
import CkElementUI from '@/components/index.js'
import confirm from '@/components/Confirm.js'
import loading from '@/components/loading.js'

import publicFun from '@/utils/publicFun'
// 引入字典项
import * as dict from '@/utils/dictionary'
// 过滤
import '@/utils/filters'

// 引入echarts
import * as echarts from 'echarts'

// 引入自定义指令
import waves from '@/directive/waves'
Vue.directive('waves', waves)
import drag from '@/directive/el-drag-dialog'
Vue.directive('drag-dialog', drag)

import clearTabIndex from '@/utils/clearTabIndex.js' // 删除el-tooltip tabindex
clearTabIndex.install(Vue)

// 根据BASEINFO配置决定是否引入mockJs
if (baseInfo.IS_MOCK_MODE) {
  require('./mockjs/')
}
Vue.use(CkElementUI)

Vue.config.productionTip = false
Vue.prototype.$baseInfo = baseInfo
Vue.prototype.$ckConfirm = confirm
Vue.prototype.$loading = loading
Vue.prototype.$echarts = echarts
Vue.prototype.$dict = dict
Vue.prototype.$utils = publicFun
Vue.prototype.$eventBus = new Vue()
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
